game-common / pragma.matchlifecycle / MatchFoundPlugin / prepareMatch /

prepareMatch #

open suspend fun prepareMatch(extCreateMatchRequest: ExtCreateMatchV1Request, extMatchmakingKey: ExtMatchmakingKey, gameServerVersion: GameServerVersion, gameServerZone: GameServerZone, players: List<MatchLifecycleCommon.MatchmakingPlayerInfo>, parties: List<PartyRpcCommon.Party>): ExtCreateMatchV1Request

Called before requesting a game server to run a new match. Use to customize the ext data to be sent to the game server after it starts up.

The createMatchRequest includes an already created ExtCreateMatchV1Request from the MatchmakingService. Optionally update this existing ext or create a new one. If no updates are needed, leave this plugin method unimplemented to use the already created ext from the createMatchRequest.

To find the party a player is in, search for a party that has a player with a matching playerId in it, like so:

val partyForPlayer = parties.find { party -> { it.playerId }.contains(player.playerId) }

Used by:

  • MatchLifecycle.createMatchV2

Return #

Return a ExtCreateMatchV1Request.

Parameters #


The initial ExtCreateMatchV1Request from the MatchmakingService.


The extMatchmakingKey representing the queue this match came from.


The game server version for the match.


The game server zone for the match.


The player that are about to join the match.


The party data for the players.