game / pragma.party / PartyService / enterMatchmakingV1 /

enterMatchmakingV1 #

suspend fun enterMatchmakingV1(session: PlayerSession, request: PartyRpc.EnterMatchmakingV1Request): PartyRpc.EnterMatchmakingV1Response

Enters a party into matchmaking.

Request validation:

If the player is not in a party, throws PragmaError.PartyService_NotInParty. If player is not a party leader, throws PragmaError.PartyService_PlayerNotLeader. If not every player in the party is ready, throws PragmaError.PartyService_PlayersNotReady.

GameServerVersion validation:

GameServerCompatibilityPlugin.calculateGameServerVersion runs a final check to determine if the game server version requested by the party is compatible with the latest configuration. If a compatible version is not found, the party is shut down with RemovalReason.GAME_CLIENTS_INCOMPATIBLE_WITH_GAME_SERVER and the endpoint throws PragmaError.PartyService_GameServerNoLongerCompatible so individual player clients can update. If Party.overrideGameServerVersion is set to true, this compatibility check behavior is disabled and does not execute.

Entering matchmaking:

PartyPlugin.buildMatchmakingKey and PartyPlugin.buildExtMatchmakingParty are both invoked to create the matchmaking payload, which is then used to make an RPC call to MatchmakingRpc.EnterMatchmakingV2Request. If the request succeeds, the party is removed from the party service and all party members will be placed into matchmaking. If the request fails, throws PragmaError.PartyService_FailedToEnterMatchmaking and the party remains within the party service.