UNPKG

steam-server-query

Version:

Module which implements the Master Server Query Protocol and Game Server Queries.

14 lines (13 loc) 1.11 kB
import { REGIONS, Filter } from './masterServerTypes'; /** * Fetch a Steam master server to retrieve a list of game server hosts. * * Read more [here](https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol). * @param masterServer Host and port of the master server to call. * @param region The region of the world where you wish to find servers in. Use REGIONS.ALL for all regions. * @param filters Optional. Object which contains filters to be sent with the query. Default is { }. Read more [here](https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol#Filter). * @param timeout Optional. Time in milliseconds after the socket request should fail. Default is 1 second. * @param maxHosts Optional. Return a limited amount of hosts. Stops calling the master server after this limit is reached. Can be used to prevent getting rate limited. * @returns A promise including an array of game server hosts. */ export declare function queryMasterServer(masterServer: string, region: REGIONS, filters?: Filter, timeout?: number, maxHosts?: number): Promise<string[]>;