Responses#

class a2squery.SourceInfo(**kwargs)#

Represents a Source server’s information response

protocol#

The version of the protocol used by the server.

Type

int

name#

The hostname of the server. This is what you see on a server list.

Type

str

map#

The current map.

Type

str

folder#

The name of the folder containing the game files. (ex. Counter-Strike: Global Offensive servers will return “csgo”)

Type

str

game#

The full name of the game the server is running.

Type

str

app_id#

The steam App ID of the server. (ex. 730 for Counter-Strike: Global Offensive servers)

Type

int

players#

The number of players on the server. This may include bots.

Type

int

max_players#

The max number of players allowed.

Type

int

bots#

The number of bots on the server.

Type

int

server_type#

The type of server. Servers can be Dedicated, NonDedicated, or SourceTV.

Type

a2squery.enums.ServerType

environment#

The operating system the server is running. For Source servers this can be Linux, Mac, or Windows.

Type

a2squery.enums.Environment

password#

Whether of not the server is password locked.

Type

bool

vac#

Indicates whether the server is protected by VAC or not.

Type

bool

version#

The version of the game installed on the server.

Type

str

extra_data_flag#

This field specifies what extra data is included in the packet.

Type

int

mode#

The game mode the server is currently running.

  • 0 for Hunt

  • 1 for Elimination

  • 2 for Duel

  • 3 for Deathmatch

  • 4 for VIP Team

  • 5 for Team Elimination

Warning

This field is only populated on servers running The Ship: Murder Party where a2squery.SourceInfo.app_id == 2400.

Type

Optional[int]

witnesses#

The number of witnesses necessary to have a player arrested.

Warning

This field is only populated on servers running The Ship: Murder Party where a2squery.SourceInfo.app_id == 2400.

Type

Optional[int]

duration#

The time before a player is arrested while being witnessed in seconds.

Warning

This field is only populated on servers running The Ship: Murder Party where a2squery.SourceInfo.app_id == 2400.

Type

Optional[int]

port#

The server’s game port.

Type

Optional[int]

steam_id#

The server’s steam ID.

Type

Optional[int]

spectator_port#

The spectator port used for SourceTV.

Type

Optional[int]

spectator_name#

The name of the SourceTV spectator server.

Type

Optional[str]

keywords#

Tags used to describe the server.

Type

Optional[str]

game_id#

The server’s 64-bit game ID.

Type

Optional[int]

class a2squery.GoldSourceInfo(**kwargs)#

Represents a GoldSource server’s info response.

address#

The IP address and port of the server.

Type

str

name#

The hostname of the server. This is what you see on a server list.

Type

str

map#

The current map.

Type

str

folder#

The name of the folder containing the game files. (ex. Counter-Strike: Global Offensive servers will return “csgo”)

Type

str

game#

The full name of the game the server is running.

Type

str

players#

The number of players on the server. This may include bots.

Type

int

max_players#

The max number of players allowed.

Type

int

protocol#

The version of the protocol used by the server.

Type

int

server_type#

The type of server. Servers can be Dedicated, NonDedicated, or SourceTV.

Type

a2squery.enums.ServerType

environment#

The operating system the server is running. For GoldSource servers this can be Linux or Windows.

Type

a2squery.enums.Environment

password#

Whether of not the server is password locked.

Type

bool

modded#

Indicates if the server is a Half-Life mod or not.

Type

bool

A URL to the mod’s website.

Danger

This field is only populated when a2squery.GoldSourceInfo.modded is True.

Type

Optional[str]

A URL to download the mod.

Danger

This field is only populated when a2squery.GoldSourceInfo.modded is True.

Type

Optional[str]

mod_version#

The version of the mod running on the server.

Danger

This field is only populated when a2squery.GoldSourceInfo.modded is True.

Type

Optional[int]

mod_size#

The space used by the mod in bytes.

Danger

This field is only populated when a2squery.GoldSourceInfo.modded is True.

Type

Optional[int]

mod_multiplayer_only#

Indicates whether the mod is multiplayer only or single-player and multiplayer.

Danger

This field is only populated when a2squery.GoldSourceInfo.modded is True.

Type

Optional[bool]

mod_uses_custom_dll#

Indicates whether the mod uses its own DLL or the Half-Life DLL.

Danger

This field is only populated when a2squery.GoldSourceInfo.modded is True.

Type

Optional[bool]

vac#

Indicates whether the server is protected by VAC or not.

Type

bool

bots#

The number of bots on the server.

Type

int

class a2squery.Player(**kwargs)#

Represents a queried player.

index#

The index of the player’s chunk. This is not the player’s index in the list of players.

Type

int

name#

The player’s name.

Type

str

score#

The player’s score. This is unique to the server/game but is usually kills/points.

Type

int

duration#

How long the player has been connected, in seconds.

Type

float

deaths#

The player’s deaths.

Warning

This field is only populated on servers running The Ship: Murder Party where a2squery.SourceInfo.app_id == 2400.

Type

Optional[int]

money#

The player’s deaths.

Warning

This field is only populated on servers running The Ship: Murder Party where a2squery.SourceInfo.app_id == 2400.

Type

Optional[int]