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.
Constructors #
MatchCapacityService | fun MatchCapacityService(pragmaNode: PragmaNode, instanceId: UUID, capacityManager: OldCapacityManager = OldCapacityManager(ServerStates(pragmaNode)), timeProxy: TimeProxy = TimeProxy(), reportCapacityCommand: OldReportCapacityCommand = OldReportCapacityCommand(capacityManager), gameInstanceClient: GameInstanceClient = GameInstanceClient()) |
Functions #
Name | Summary |
---|---|
Reports available game server capacity. Called by game servers. Response can include a list of matches for the game server to start. | |
Registered as a new MatchRequest for this game instance to find a game server. |