Class representing a game.

Hierarchy

Constructors

  • new STGame(id: number): STGame

Properties

clients?: number

Number of clients that were present.

date?: Date

The date when this game happened.

fetched: boolean = false

True if the class was fetched

id: number

The SauerTracker game ID.

map?: string

The name of the map this game was played on.

meta?: [string, number]

Metadata for this game. Possibilities known to me:

type String Number
clanwar clan tag score
duel player name score

Please add or notify me of any and all other possibilities you find.

mode?: string

The game mode used for this game.

players?: STGamePlayer[]

An array of the players involved, including spectators.

server?: STServer

The server used for the game.

teams?: STTeam[]

An array containing the teams that participated.

type?: string

The type of game this was. public, duel, mix, clanwar, intern, or other

Methods

  • Fetches the data from the API, filling out the current object. This should be an asynchronous function.

    Returns

    This object after fetching

    Returns Promise<STAsync>

  • isFetched(): boolean
  • Returns

    True if this object is fetched

    Returns boolean

  • Sets properties based on the response sent from a request

    Returns

    This object after setting properties

    Parameters

    • data: any

      The response data from the API

    Returns STGame

  • find(host?: string, port?: string | number): Promise<STResults>
  • Asynchronously finds up to 20 games that match the given query. Both arguments are optional. Results are sorted by frags descendingly.

    Returns

    The search results and stats.

    Parameters

    • host: string = ""

      The host server of the game.

    • port: string | number = ""

      The port of the server.

    Returns Promise<STResults>

Generated using TypeDoc