Class representing a server.

Hierarchy

Constructors

  • new STServer(host: string, port: number): STServer
  • Parameters

    • host: string

      The host or IP of the server.

    • port: number

      The port of the server.

    Returns STServer

Properties

clients?: number

The number of clients on the server.

country?: STCountry

Where the server is based.

description?: string

The server's description.

descriptionStyled?: string

The description styled with html.

fetched: boolean = false

True if the class was fetched

game?: STLiveGame

The game that's currently in progress on the server.

host: string

The host or IP of the server.

The server info.

isFull?: boolean

Whether or not the server is full.

masterMode?: string

The current master mode of the server.

maxClients?: number

The maximum number of clients the server supports.

port: number

The port of the server.

rank?: number

The server's rank.

totalGames?: number

How many games have been played on the server.

version?: number

The version the server is running.

zombie?: boolean

Whether or not the server is a zombie server.

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<STServer>

  • 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 STServer

  • List all servers online

    Returns Promise<STServer[]>

Generated using TypeDoc