game / pragma.matchcapacity / MatchCapacityService /

MatchCapacityService #

class MatchCapacityService(pragmaNode: PragmaNode, instanceId: UUID, capacityManager: OldCapacityManager = OldCapacityManager(ServerStates(pragmaNode)), timeProxy: TimeProxy = TimeProxy(), reportCapacityCommand: OldReportCapacityCommand = OldReportCapacityCommand(capacityManager), gameInstanceClient: GameInstanceClient = GameInstanceClient()) : DistributedService, ConfigHandler<MatchCapacityServiceConfig>

MatchCapacityService is responsible for managing overall game server capacity.

All new matches that need to be created are registered with this service. Game servers report their capacity for matches to this service, and receive in response a list of new matches to create.

Using the match capacity configuration MatchCapacityServiceConfig.matchCapacityConfig, you may define how much capacity the service should maintain. Additionally, you can configure 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.

DEPRECATED in version 0.0.99 REMOVAL by 0.0.101. Use FleetService.

Constructors #

MatchCapacityService

fun MatchCapacityService(pragmaNode: PragmaNode, instanceId: UUID, capacityManager: OldCapacityManager = OldCapacityManager(ServerStates(pragmaNode)), timeProxy: TimeProxy = TimeProxy(), reportCapacityCommand: OldReportCapacityCommand = OldReportCapacityCommand(capacityManager), gameInstanceClient: GameInstanceClient = GameInstanceClient())

Functions #

NameSummary

reportCapacityV2

suspend fun reportCapacityV2(session: PartnerSession, request: MatchCapacityRpc.ReportCapacityV2Request): MatchCapacityRpc.ReportCapacityV2Response

Reports available game server capacity. Called by game servers. Response can include a list of matches for the game server to start.

startGameInstanceV1

suspend fun startGameInstanceV1(session: ServiceSession, request: MatchCapacityRpc.StartGameInstanceV1Request): MatchCapacityRpc.StartGameInstanceV1Response

Registered as a new MatchRequest for this game instance to find a game server.