game / pragma.matchmaking / MatchmakingService /

MatchmakingService #

@ExperimentalCoroutinesApi

internal class MatchmakingService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, uuidProxy: UUIDProxy = UUIDProxy(), matchmakingQueues: MatchmakingQueues = MatchmakingQueues( MetrickingMutexFactory(pragmaNode, "MatchmakingQueues").get( MatchmakingQueues::class.qualifiedName!! ) ), partyClient: PartyClient = PartyClient(), gameInstanceClient: GameInstanceClient = GameInstanceClient(), timeProxy: TimeProxy = TimeProxy.defaultInstance, randomProxy: RandomProxy = RandomProxy(), matchmakingNotificationClient: MatchmakingNotificationClient = MatchmakingNotificationClient()) : DistributedService, ConfigHandler<MatchmakingConfig> , MatchReleaser

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: <ERROR CLASS>, uuidProxy: UUIDProxy = UUIDProxy(), matchmakingQueues: MatchmakingQueues = MatchmakingQueues( MetrickingMutexFactory(pragmaNode, "MatchmakingQueues").get( MatchmakingQueues::class.qualifiedName!! ) ), partyClient: PartyClient = PartyClient(), gameInstanceClient: GameInstanceClient = GameInstanceClient(), timeProxy: TimeProxy = TimeProxy.defaultInstance, randomProxy: RandomProxy = RandomProxy(), matchmakingNotificationClient: MatchmakingNotificationClient = MatchmakingNotificationClient())

Functions #

NameSummary

enterMatchmakingV2

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

Enters a group of players into matchmaking, processing all players through MatchmakingPlugin.initialize.

enterMatchmakingWithGameInstanceV1

suspend fun enterMatchmakingWithGameInstanceV1(session: ServiceSession, request: MatchmakingRpc.EnterMatchmakingWithGameInstanceV1Request): MatchmakingRpc.EnterMatchmakingWithGameInstanceV1Response

Enters a game instance into matchmaking. Used by the game instance service.

getCacheInfoOperatorV1

suspend fun getCacheInfoOperatorV1(session: OperatorSession, request: MatchmakingRpc.GetCacheInfoOperatorV1Request): MatchmakingRpc.GetCacheInfoOperatorV1Response

Queries information on matchmaking queues.

getMatchmakingInfoV2

suspend fun getMatchmakingInfoV2(session: PlayerSession, request: MatchmakingRpc.GetMatchmakingInfoV2Request): MatchmakingRpc.GetMatchmakingInfoV2Response

Queries summarized information on matchmaking queues.

leaveMatchmakingV1

suspend fun leaveMatchmakingV1(session: ServiceSession, request: MatchmakingRpc.LeaveMatchmakingV1Request): MatchmakingRpc.LeaveMatchmakingV1Response

Removes a player and their party from matchmaking. pragma.party.PartyPlugin.returnFromMatchmaking will fire within the party service.

leaveMatchmakingV2

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

Removes a player and their party from matchmaking. pragma.party.PartyPlugin.returnFromMatchmaking will fire within the party service.

onSessionTerminated

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

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

queryMatchmakingStatusV1

suspend fun queryMatchmakingStatusV1(session: ServiceSession, request: MatchmakingRpc.QueryMatchmakingStatusV1Request): MatchmakingRpc.QueryMatchmakingStatusV1Response

Queries matchmaking status information about specific players.

removeGameInstanceFromMatchmakingV1

suspend fun removeGameInstanceFromMatchmakingV1(session: ServiceSession, request: MatchmakingRpc.RemoveGameInstanceFromMatchmakingV1Request): MatchmakingRpc.RemoveGameInstanceFromMatchmakingV1Response

Removes a game instance from matchmaking.

removeGameServerVersionV1

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

Removes all players from any queues that target a specified list of game server versions.

updateMatchmakingGameInstanceV1

suspend fun updateMatchmakingGameInstanceV1(session: ServiceSession, request: MatchmakingRpc.UpdateMatchmakingGameInstanceV1Request): MatchmakingRpc.UpdateMatchmakingGameInstanceV1Response

Updates a game instance within matchmaking. Used by the game instance service.