game-common / pragma.fleet / DefaultFleetPlugin /

DefaultFleetPlugin #

open class DefaultFleetPlugin(service: Service, contentDataNodeService: ContentDataNodeService) : FleetPlugin

This plugin provides a way to get your local development flow working before you configure your server pools.

It does not have the fleet service allocate your game servers, allowing you to manage your own development game server.

If you use a shared Pragma shard, specify a unique overrideGameServerVersion in your party and start a server that calls reportCapacity with a serverPoolId that matches your overrideGameServerVersion. This allows you to connect your local game clients to your local game server.

This plugin uses a pool management policy defined in dev-defaults.yml to provide heartbeat configuration to your server when it reports capacity. The provided management policy is designed as a starting point to get you running and extend as your needs require.

Constructors #

DefaultFleetPlugin

fun DefaultFleetPlugin(service: Service, contentDataNodeService: ContentDataNodeService)

Functions #

NameSummary

add

open suspend override 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

open suspend override 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 override 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

open suspend override fun selectServerPool(gameServerVersion: <ERROR CLASS>, gameServerZone: <ERROR CLASS>, extHostRequest: ExtHostRequest): 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.