game / pragma.matchlifecycle / MatchLifecycleService /

MatchLifecycleService #

internal class MatchLifecycleService(pragmaNode: PragmaNode, instanceId: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, matchEndMetrics: MatchEndMetrics = MatchEndMetrics( Metrics(pragmaNode.metricsRegistry), LoggerFactory.getLogger(MatchEndMetrics::class.java) ), matchEndCommand: MatchEndCommand = MatchEndCommand(), matchesInProcess: MatchesInProcess = MatchesInProcess(), sessionClient: SessionClient = SessionClient()) : DistributedService, ConfigHandler<MatchLifecycleServiceConfig>

MatchLifecycle service is a game loop service responsible for creating matches, sending match connection details to players, and handling any match end processing.

Constructors #

MatchLifecycleService

fun MatchLifecycleService(pragmaNode: PragmaNode, instanceId: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, matchEndMetrics: MatchEndMetrics = MatchEndMetrics( Metrics(pragmaNode.metricsRegistry), LoggerFactory.getLogger(MatchEndMetrics::class.java) ), matchEndCommand: MatchEndCommand = MatchEndCommand(), matchesInProcess: MatchesInProcess = MatchesInProcess(), sessionClient: SessionClient = SessionClient())

Functions #

NameSummary

createMatchV2

suspend fun createMatchV2(session: ServiceSession, request: MatchLifecycleRpc.CreateMatchV2Request): MatchLifecycleRpc.CreateMatchV2Response

Create a new match. Invoked in Party-based workflows.

matchAllocationFailureV1

suspend fun matchAllocationFailureV1(session: ServiceSession, request: MatchLifecycleRpc.MatchAllocationFailureV1Request): MatchLifecycleRpc.MatchAllocationFailureV1Response

Signals a match has failed to start. Invoked by the MatchCapacityService, and works for party flows.

matchConnectionDetailsV1

suspend fun matchConnectionDetailsV1(session: PlayerSession, request: MatchLifecycleRpc.MatchConnectionDetailsV1Request): MatchLifecycleRpc.MatchConnectionDetailsV1Response

Provides the current match details for a player.

matchEndV4

suspend fun matchEndV4(session: PartnerSession, request: MatchLifecycleRpc.MatchEndV4Request): MatchLifecycleRpc.MatchEndV4Response

Signals a match has completed. Invoked by the game server.

matchKeepAliveV1

suspend fun matchKeepAliveV1(session: PartnerSession, request: MatchLifecycleRpc.MatchKeepAliveV1Request): MatchLifecycleRpc.MatchKeepAliveV1Response

Invoked by the game server to indicate that a match is still operating normally.

matchReadyV2

suspend fun matchReadyV2(session: PartnerSession, request: MatchLifecycleRpc.MatchReadyV2Request): MatchLifecycleRpc.MatchReadyV2Response

Signals a match is ready to join. Invoked by the game server.

matchReconnectServiceV1

suspend fun matchReconnectServiceV1(session: ServiceSession, request: MatchLifecycleRpc.MatchReconnectServiceV1Request): MatchLifecycleRpc.MatchReconnectServiceV1Response

Attempts to reconnect a player to a match.

playerLeaveV1

suspend fun playerLeaveV1(session: PartnerSession, request: MatchLifecycleRpc.PlayerLeaveV1Request): MatchLifecycleRpc.PlayerLeaveV1Response

Processes a match end for a subset of players within a match. Does not end the match.