game-common / pragma.fleet / FleetPlugin /

FleetPlugin #

interface FleetPlugin

FleetPlugin provides an abstract interface for defining a game server fleet management model.

Pragma provides some reference examples for existing platforms:

  • PragmaNomadFleetPlugin - Run game servers using Nomad.
  • MultiplayFleetPlugin - Run game servers using Multiplay.
  • LocalProcessFleetPlugin - Run game servers using local hardware.
  • DefaultFleetPlugin - Used when not running game servers (eg. local platform development).

Functions #

NameSummary

add

abstract suspend fun add(serverPool: ServerPool, allocations: List<GameServerAllocation>)

Allocate additional game servers for a specific server pool. The number of game servers to allocate is calculated using the values configured in the ServerPoolManagementPolicyConfig configuration block associated with the supplied server pool, identified by ServerPool.managementPolicyId. When allocating game servers, include the server id and ServerPool.serverPoolId assigned to that server in the allocation payload.

getServerPoolById

abstract suspend fun getServerPoolById(serverPoolId: String): ServerPool

Determine what server pool should be used when given a ServerPool.serverPoolId. This is used as a fallback in the case that your server pool reports a server id that is unrecognized by Pragma. This situation can occur when you are using a local game server not allocated via FleetService.

init

open fun init(client: TimedHttpClient)

Provides an HttpClient to communicate with external resources for allocating game servers. Consider inheriting DefaultFleetPlugin for an implementation of this.

selectServerPool

abstract suspend fun selectServerPool(gameServerVersion: <ERROR CLASS>, gameServerZone: <ERROR CLASS>, ext: ExtAllocateGameServer): ServerPool

Determine what server pool should be used when allocating game servers for the given game allocation request details. The ServerPool.serverPoolId is used to differentiate the queues of capacity allocation requests.

Inheritors #

Name

DefaultFleetPlugin