Interface SourceServerInfo

Represents the server information returned by the A2S_INFO query. This interface supports both Source Engine and Obsolete GoldSource responses.

interface SourceServerInfo {
    address?: string;
    bots: number;
    environment: string;
    extraData?: {
        gameID?: bigint;
        keywords?: string;
        port?: number;
        steamID?: bigint;
        tvName?: string;
        tvPort?: number;
    };
    folder: string;
    game: string;
    id?: number;
    map: string;
    maxPlayers: number;
    mod?: {
        dll: number;
        downloadLink: string;
        link: string;
        size: number;
        type: number;
        version: number;
    };
    name: string;
    players: number;
    protocol: number;
    serverType: string;
    vac: number;
    version?: string;
    visibility: number;
}

Properties

address?: string

IP address and port of the server (Obsolete GoldSource only).

bots: number

Number of bots on the server.

environment: string

Operating system of the server:

  • 'L' for Linux
  • 'W' for Windows
extraData?: {
    gameID?: bigint;
    keywords?: string;
    port?: number;
    steamID?: bigint;
    tvName?: string;
    tvPort?: number;
}

Additional data specific to Source Engine servers.

Type declaration

  • OptionalgameID?: bigint

    Game ID (if extraDataFlag & 0x01).

  • Optionalkeywords?: string

    Server keywords (if extraDataFlag & 0x20).

  • Optionalport?: number

    Port of the server (if extraDataFlag & 0x80).

  • OptionalsteamID?: bigint

    Steam ID of the server (if extraDataFlag & 0x10).

  • OptionaltvName?: string

    SourceTV name (if extraDataFlag & 0x40).

  • OptionaltvPort?: number

    SourceTV port (if extraDataFlag & 0x40).

folder: string

Name of the folder containing the game files.

game: string

Full name of the game.

id?: number

Steam App ID of the game (Source Engine only).

map: string

Map the server has currently loaded.

maxPlayers: number

Maximum number of players the server reports it can hold.

mod?: {
    dll: number;
    downloadLink: string;
    link: string;
    size: number;
    type: number;
    version: number;
}

Mod-specific information (Obsolete GoldSource only).

Type declaration

  • dll: number

    Whether mod uses its own DLL:

    • 0 if it uses the Half-Life DLL
    • 1 if it uses its own DLL
  • downloadLink: string

    URL to download the mod.

  • link: string

    URL to mod website.

  • size: number

    Space (in bytes) the mod takes up.

  • type: number

    Type of mod:

    • 0 for single and multiplayer mod
    • 1 for multiplayer-only mod
  • version: number

    Version of mod installed on server.

name: string

Name of the server.

players: number

Number of players on the server.

protocol: number

Protocol version used by the server.

serverType: string

Type of server:

  • 'D' for dedicated server
  • 'L' for non-dedicated server
  • 'P' for HLTV server
vac: number

Whether the server uses VAC:

  • 0 for unsecured
  • 1 for secured
version?: string

Version of the game (Source Engine only).

visibility: number

Whether the server requires a password:

  • 0 for public
  • 1 for private