game-common / pragma.matchmaking / MatchmakingStrategy / addToMatchAndBuildMatchmakingDetails /

addToMatchAndBuildMatchmakingDetails #

abstract fun addToMatchAndBuildMatchmakingDetails(matchmakingKey: ExtMatchmakingKey, partiesByTeamId: MutableMap<Int, MutableSet<MatchmakingParty>>, partyToAdd: MatchmakingParty): Pair<ExtCreateMatchV1Request, String>?

Used to form a match of PartyService-based players. Will be invoked many times during the matchmaking loop. Each time it is called, determine if the partyToAdd should be part of the match you are forming. If they are, add them to partiesByTeamId. If adding that party means your match is ready to play, return an ExtCreateMatchV1Request. If you still need more players, return null.

In the case that you would like to assign different teams to players that are in the same party you can do so by modifying the MatchmakingPlayerInfo inside partiesByTeamId and assigning the teamNumber field to a custom value which will override the index their party is assigned to in partiesByTeamId

Used by:

  • AllPartyQueues.runMatchmaking Runs forever to attempt to create matches.

Return #

Return an ExtCreateMatchV1Request if the match is ready to go to game and a string that specifies which game server zone the match should land on. Return null to continue matchmaking.

Parameters #


The matchmaking key the party is being added to.


The current list of teams in the match. Add partyToAdd to this list if they should be in the match.


The new party that is being considered to add to the match.