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. If any player is already in a game or in matchmaking, throws PragmaError.PartyService_InvalidSession.

GameServerVersion validation:

GameServerCompatibility.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 endpoint throws PragmaError.PartyService_GameServerNoLongerCompatible so individual player clients can update, and a warning will be logged. Any player that does not have a supported game server version will receive a PartyRpc.GameClientNotSupportedV1Notification, and all other players will receive a PartyRpc.PartyClientVersionMismatchV1Notification. If PartyImpl.overrideGameServerVersion has been set, the game server calculation will be skipped and the previously set gameServerVersion will be used.

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.