A2S Query CLI and go package
Powerful command-line utility and Go packages for querying Steam A2S server information. Built with specific support for Arma 3 and DayZ, this tool provides a seamless way to retrieve essential server data.
A2S supports querying Steam servers using the following methods:
A2S_INFO: Retrieve basic information about the server, such as name,
map, and player count. (CLI and package)A2S_PLAYER: Get details about each player currently on the server.
(CLI and package)A2S_RULES: Fetch server-specific rules and settings. (CLI and package)A2S_SERVERQUERY_GETCHALLENGE: Request a challenge number for use in
player and rules queries. (only package)A2A_PING: Measure the ping time to the server for latency insights.
(only package)Additionally, this tool features an extension for the Arma 3 Server Browser
Protocol (A3SBP). This extension overrides the standard GetRules() method,
enabling compatibility with the unique protocol used by Arma 3's server
browser.
You can download the latest version of the programme by following the links:
| MacOS | Linux | Windows | |
|---|---|---|---|
| AMD64 | a2s-darwin-amd64 | a2s-linux-amd64 | a2s-windows-amd64 |
| ARM64 | a2s-darwin-arm64 | a2s-linux-arm64 | a2s-windows-arm64 |
You can also use the command (for Linux amd64, adjust for your platform):
curl -#SfLo /usr/bin/a2s \
https://github.com/WoozyMasta/a2s/releases/latest/download/a2s-linux-amd64
chmod +x /usr/bin/a2s
a2s -h && a2s -v
Command-line utility for querying Steam A2S server information with support for Arma 3 and DayZ servers.
The utility supports the following commands:
info - Retrieve server information A2S_INFOrules - Retrieve server rules A2S_RULESplayers - Retrieve player list A2S_PLAYERSall - Retrieve all available server informationping - Ping the server with A2S_INFOFor detailed information about available options and flags, run a2s --help.
Example of use:
client, err := a2s.New("127.0.0.1", 27016)
if err != nil {
panic(err)
}
defer client.Close()
client.SetBufferSize(2048)
client.SetDeadlineTimeout(3)
info, err := client.GetInfo()
if err != nil {
panic(err)
}
rules, err := client.GetRules()
if err != nil {
panic(err)
}
github.com/woozymasta/a2s.GetInfo() -> A2S_INFOgithub.com/woozymasta/a2s.GetPlayers() -> A2S_PLAYERgithub.com/woozymasta/a2s.GetRules() -> A2S_RULESgithub.com/woozymasta/a2s.GetChallenge() -> A2S_SERVERQUERY_GETCHALLENGEgithub.com/woozymasta/a2s.GetPing() -> A2A_PINGExample of use:
client, err := a2s.New("127.0.0.1", 27016)
if err != nil {
panic(err)
}
defer client.Close()
// Wrap client
a3Client := &a3sb.Client{Client: client}
// Game id must be passed as the second argument to properly read the Arma 3 or Dayz rules
rules, err := a3Client.GetRules(221100)
if err != nil {
panic(err)
}
// Can also perform standard a2s methods
info, err := a3Client.GetInfo()
if err != nil {
panic(err)
}
For a deeper understanding of the protocols used, refer to the official documentation:
During development, the functionality of a2s was
thoroughly tested across a diverse range of popular games that utilize the
Steam server query protocols.
This ensures compatibility and reliable performance.
The following games were used for testing:
These games represent a wide array of server types and implementations, highlighting the versatility of the tools in querying servers effectively across various scenarios.
Feel free to contribute or report issues if you find any compatibility problems with additional games!
[!NOTE]
Implementation ofbzip2compression for multi-packet response is not implemented, as I did not find any servers that would respond in this format. If you know of one, please write me in issue.
Your support is greatly appreciated!