Class AirshipTransferService

The transfer service allows you to move players between servers and create new servers.

Properties

onShutdown: Signal<void> = ...

Fired when the server begins shutting down.

You can yield for up to 30 minutes to perform shutdown logic. You can also yield to ensure an in-progress match is completed.

transferPlayersOnShutdown: boolean = true

If true, players are automatically transfered into a new server when the server shuts down.

We try to transfer all players to the same server so they stay together.

Methods

  • Creates a new server and returns a server id which can be used to transfer players to the new server.

    Parameters

    • Optional config: AirshipServerConfig

      The configuration the server should start with. If not provided, the server will use the defaults provided during deployment.

    Returns Promise<Result<CreateServerResponse, undefined>>

    The id of the new server. Undefined if the server was not able to be created.

  • Transfers a group of players to the provided game. A server in the default scene will be selected, or a new one will be created.

    Parameters

    Returns Promise<Result<undefined, undefined>>

  • Transfers a group of players to the provided server. The server can be in any scene, but must be part of the current servers game.

    Parameters

    Returns Promise<Result<undefined, undefined>>

  • Transfers a player to the provided game. A server in the default scene will be selected, or a new one will be created.

    Parameters

    Returns Promise<Result<undefined, undefined>>

  • Transfers a player to the provided server. The server can be in any scene, but must be part of the current servers game.

    Parameters

    Returns Promise<Result<undefined, undefined>>