./a2s

A2S Query CLI and go package


A2S

MetricZ

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.

Description

A2S supports querying Steam servers using the following methods:

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.

CLI Installation

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

A2S CLI

Command-line utility for querying Steam A2S server information with support for Arma 3 and DayZ servers.

The utility supports the following commands:

For detailed information about available options and flags, run a2s --help.

Package

A2S

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)
}

A3SB

Example 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)
}

Protocol Documentation

For a deeper understanding of the protocols used, refer to the official documentation:

Tested Games

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 of bzip2 compression 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.

👉 Support Me

Your support is greatly appreciated!