opengsq.responses.source package
Submodules
opengsq.responses.source.environment module
- class opengsq.responses.source.environment.Environment(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
Indicates the operating system of the server.
- Linux = 108
Linux
- Windows = 119
Windows
- Mac = 109
Mac
- static parse(byte: int)
Parses the given byte to an Environment value. If the byte does not correspond to a valid Environment value, it defaults to Environment.Mac.
- Args:
byte (int): The byte to parse.
- Returns:
Environment: The corresponding Environment value, or Environment.Mac if the byte is not valid.
opengsq.responses.source.extra_data_flag module
- class opengsq.responses.source.extra_data_flag.ExtraDataFlag(flags: int)
Bases:
int
Extra Data Flag (EDF)
- Port = 128
Port
- SteamID = 16
SteamID
- Spectator = 64
Spectator
- Keywords = 32
Keywords
- GameID = 1
GameID
- has_flag(flag: int)
Checks if the ExtraDataFlag has the given flag.
- Parameters:
flag – The flag to check.
- Returns:
True if the ExtraDataFlag has the flag, False otherwise.
opengsq.responses.source.gold_source_info module
- class opengsq.responses.source.gold_source_info.GoldSourceInfo(protocol: int, name: str, map: str, folder: str, game: str, players: int, max_players: int, bots: int, server_type: ServerType, environment: Environment, visibility: Visibility, vac: VAC, address: str, mod: int, link: str | None = None, download_link: str | None = None, version: int | None = None, size: int | None = None, type: int | None = None, dll: int | None = None)
Bases:
PartialInfo
Obsolete GoldSource Response
- address: str
IP address and port of the server.
- mod: int
Indicates whether the game is a mod 0 for Half-Life 1 for Half-Life mod
- link: str | None = None
URL to mod website.
- download_link: str | None = None
URL to download the mod.
- version: int | None = None
Version of mod installed on server.
- size: int | None = None
Space (in bytes) the mod takes up.
- type: int | None = None
Indicates the type of mod: 0 for single and multiplayer mod 1 for multiplayer only mod
- dll: int | None = None
Indicates whether mod uses its own DLL: 0 if it uses the Half-Life DLL 1 if it uses its own DLL
opengsq.responses.source.partial_info module
- class opengsq.responses.source.partial_info.PartialInfo(protocol: int, name: str, map: str, folder: str, game: str, players: int, max_players: int, bots: int, server_type: ServerType, environment: Environment, visibility: Visibility, vac: VAC)
Bases:
object
A2S_INFO Partial Info
- protocol: int
Protocol version used by the server.
- name: str
Name of the server.
- map: str
Map the server has currently loaded.
- folder: str
Name of the folder containing the game files.
- game: str
Full name of the game.
- players: int
Number of players on the server.
- max_players: int
Maximum number of players the server reports it can hold.
- bots: int
Number of bots on the server.
- server_type: ServerType
Indicates the type of server.
- environment: Environment
Indicates the operating system of the server.
- visibility: Visibility
Indicates whether the server requires a password.
opengsq.responses.source.player module
- class opengsq.responses.source.player.Player(name: str, score: int, duration: float, deaths: int | None = None, money: int | None = None)
Bases:
object
Player Data
- name: str
Player Name
- score: int
Player Score
- duration: float
Player Duration
- deaths: int | None = None
Player Deaths
- money: int | None = None
Player Money
opengsq.responses.source.server_type module
- class opengsq.responses.source.server_type.ServerType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
Indicates the type of server.
- Dedicated = 100
Dedicated server
- Listen = 108
Listen server
- Proxy = 112
SourceTV relay (proxy)
- static parse(byte: int)
Parses the given byte to a ServerType value. If the byte does not correspond to a valid ServerType value, a ValueError is raised.
- Args:
byte (int): The byte to parse.
- Returns:
ServerType: The corresponding ServerType value.
opengsq.responses.source.source_info module
- class opengsq.responses.source.source_info.SourceInfo(protocol: int, name: str, map: str, folder: str, game: str, players: int, max_players: int, bots: int, server_type: ServerType, environment: Environment, visibility: Visibility, vac: VAC, id: int, version: str, edf: ExtraDataFlag | None = None, port: int | None = None, steam_id: int | None = None, spectator_port: int | None = None, spectator_name: str | None = None, keywords: str | None = None, game_id: int | None = None, mode: int | None = None, witnesses: int | None = None, duration: int | None = None)
Bases:
PartialInfo
Source Response
- id: int
Steam Application ID of game.
- version: str
Version of the game installed on the server.
- edf: ExtraDataFlag | None = None
If present, this specifies which additional data fields will be included.
- port: int | None = None
The server’s game port number.
- steam_id: int | None = None
Server’s SteamID.
- spectator_port: int | None = None
Spectator port number for SourceTV.
- spectator_name: str | None = None
Name of the spectator server for SourceTV.
- keywords: str | None = None
Tags that describe the game according to the server (for future use.)
- game_id: int | None = None
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.
- mode: int | None = None
Indicates the game mode.
- witnesses: int | None = None
The number of witnesses necessary to have a player arrested.
- duration: int | None = None
Time (in seconds) before a player is arrested while being witnessed.