game / pragma.fleet / FleetService /
FleetService #
class FleetService(pragmaNode: PragmaNode, instanceId: UUID, capacityManager: CapacityManager = CapacityManager(CapacityTracker(pragmaNode)), timeProxy: TimeProxy = TimeProxy(), reportCapacityCommand: ReportCapacityCommand = ReportCapacityCommand(capacityManager), gameInstanceClient: GameInstanceClient = GameInstanceClient()) : DistributedService, ConfigHandler<FleetServiceConfig>
FleetService is responsible for managing overall game server capacity.
All new game instances that need to be created are registered with this service. Game servers report their capacity for game instances to this service, and receive in response a list of new game instances to create.
FleetService allows you to subdivide your game server fleet by two facets: Server Pool Management Policies and Server Pools.
Using the config FleetServiceConfig.serverPoolManagementPolicies, you may define one or more server pool management policies. Each policy defines capacity characteristics across a homogenous pool of game servers. These characteristics include number of game instances per server, min/max game instance capacity of the pool, how long your game servers have to allocate a game, how often they should report their capacity to the service, and how long the service should wait for a report to arrive before considering a game server timed out.
Server pools let you further break down your fleet based on your own criteria FleetExt.ExtServerPool such as game server zone.
One management policy may many server pools.
Constructors #
FleetService | fun FleetService(pragmaNode: PragmaNode, instanceId: UUID, capacityManager: CapacityManager = CapacityManager(CapacityTracker(pragmaNode)), timeProxy: TimeProxy = TimeProxy(), reportCapacityCommand: ReportCapacityCommand = ReportCapacityCommand(capacityManager), gameInstanceClient: GameInstanceClient = GameInstanceClient()) |
Functions #
Name | Summary |
---|---|
Reports available game server capacity. Called by game servers. Response can include a list of game instances for the game server to start. | |
Registered as a new AllocationRequest for this game instance to find a game server. |