game-common / pragma.matchmaking / MatchmakingPlugin /

MatchmakingPlugin #

interface MatchmakingPlugin

The MatchmakingPlugin is an extension point for defining all custom matchmaking logic within the engine. From here, the plugin author can manipulate every Matchmaking.Party as it enters matchmaking, as well as perform comparisons between two matchables, checking to see if a valid game instance can be made.

Functions #

NameSummary

endOfLoop

open fun endOfLoop(queueKey: MatchmakingRpc.MatchmakingQueueKey, anchor: Matchmaking.Matchable): NewGameInstance?

Called after completing a matchmaking loop to give the plugin a chance to start a new game instance even if it was not filled during the iteration.

initialize

open fun initialize(queueKey: MatchmakingRpc.MatchmakingQueueKey, party: Matchmaking.Party): NewGameInstance?

Called with a new Matchmaking.Party before it enters matchmaking. Perform any validation logic or initial transformations to party or players here. Return a NewGameInstance to start the game instance before it enters the matchmaking queue. Return null to continue to the matchmaking queue. If the Matchmaking.Party is not valid, prevent it from entering matchmaking by throwing an ExtException.

matchParties

open fun matchParties(queueKey: MatchmakingRpc.MatchmakingQueueKey, anchor: Matchmaking.Matchable, other: Matchmaking.Matchable): NewGameInstance?

Called during the main matchmaking loop. The anchor Matchmaking.Matchable represents a collection of parties that could form the teams for a game. Parties can be moved between the matchable and the anchor. This method is called many times, evaluating each party that has joined the matchmaking queue. When the criteria to start a new game is met, return a NewGameInstance from this method to be sent to the game server.

matchPartiesWithGame

open fun matchPartiesWithGame(queueKey: MatchmakingRpc.MatchmakingQueueKey, anchor: Matchmaking.Matchable, game: Matchmaking.GameInstance): GameInstanceUpdate?

Called during the main matchmaking loop. The Matchmaking.GameInstance represents a live game instance that has re-entered matchmaking, and this method will not be called until a Matchmaking.GameInstance has re-entered matchmaking requesting more players. The Matchmaking.Matchable contains parties that could be added to the Matchmaking.GameInstance. This method is called many times, evaluating each party that has joined the matchmaking queue.

Inheritors #

Name

WarmBodyMatchmakingPlugin