game / pragma.matchmaking / MatchmakingService /

MatchmakingService #

internal class MatchmakingService(pragmaNode: PragmaNode, instanceId: UUID, uuidProxy: UUIDProxy = UUIDProxy(), oldPartyQueues: OldPartyQueues = OldPartyQueues(), partyQueues: PartyQueues = PartyQueues(), sessionClient: SessionClient = SessionClient()) : DistributedService, ConfigHandler<MatchmakingConfig> , MatchRemover

The MatchmakingService is a game loop service responsible for matching players together using configurable queues. The service maintains a collection of all active matchmaking queues, which it constantly iterates through on a configurable timer (MatchmakingConfig.matchmakingDelayMillis) attempting to make a match using the matchmaking plugin.

Constructors #

MatchmakingService

fun MatchmakingService(pragmaNode: PragmaNode, instanceId: UUID, uuidProxy: UUIDProxy = UUIDProxy(), oldPartyQueues: OldPartyQueues = OldPartyQueues(), partyQueues: PartyQueues = PartyQueues(), sessionClient: SessionClient = SessionClient())

Functions #

NameSummary

enterMatchmakingV2

suspend fun enterMatchmakingV2(session: ServiceSession, request: MatchmakingRpc.EnterMatchmakingV2Request): MatchmakingRpc.EnterMatchmakingV2Response

Enters a group of players into matchmaking.

enterMatchmakingWithMatchV1

suspend fun enterMatchmakingWithMatchV1(session: ServiceSession, request: MatchmakingRpc.EnterMatchmakingWithMatchV1Request): MatchmakingRpc.EnterMatchmakingWithMatchV1Response

Enters a match in process back into matchmaking. This endpoint is invoked from MatchLifecycleRpc.RequestMorePlayersV1Request and results in an ActiveMatch being placed back in the matchmaking queue

getMatchmakingInfoV1

suspend fun getMatchmakingInfoV1(session: PlayerSession, request: MatchmakingRpc.GetMatchmakingInfoV1Request): MatchmakingRpc.GetMatchmakingInfoV1Response

Queries information on matchmaking queues.

leaveMatchmakingServiceV1

suspend fun leaveMatchmakingServiceV1(session: ServiceSession, request: MatchmakingRpc.LeaveMatchmakingServiceV1Request): MatchmakingRpc.LeaveMatchmakingServiceV1Response

Called from PartyService when a player leaves or is kicked from a party. Removes the whole party from matchmaking.

leaveMatchmakingV2

suspend fun leaveMatchmakingV2(session: PlayerSession, request: MatchmakingRpc.LeaveMatchmakingV2Request): MatchmakingRpc.LeaveMatchmakingV2Response

Allows a player to leave matchmaking. Removes their whole party from matchmaking.

onSessionReconnected

suspend fun onSessionReconnected(notification: PlayerSessionRpc.SessionReconnectedV1Notification)

Notification handler for player reconnect. Removes parties in matchmaking from queue if any player reconnects.

onSessionTerminated

open suspend override fun onSessionTerminated(notification: PlayerSessionRpc.SessionTerminatedForServiceV1Notification)

Notification handler for player disconnect. Removes parties in matchmaking from queue if any player disconnects.

removeGameServerVersionV1

suspend fun removeGameServerVersionV1(session: ServiceSession, request: MatchmakingRpc.RemoveGameServerVersionV1Request): MatchmakingRpc.RemoveGameServerVersionV1Response

Remove a GameServerVersion from matchmaking. Any players that were in queue for game server versions being removed will be removed from the game loop and sent a MatchmakingRpc.MatchmakingFailureV1Notification.