game / pragma.party / PartyService / joinWithPartyIdV1 /
joinWithPartyIdV1 #
suspend fun joinWithPartyIdV1(session: PlayerSession, request: PartyRpc.JoinWithPartyIdV1Request): PartyRpc.JoinWithPartyIdV1Response
Joins a party with a party ID.
Party validation:
The party corresponding to the request’s party id is retrieved. If the party cannot be found, fails with PragmaError.PartyService_PartyNotFound. If the party is full, fails with PragmaError.PartyService_PartyFull.
GameServerVersion recalculation:
GameServerCompatibility.calculateGameServerVersion is invoked to determine the overall GameServerVersion for the party if the new player joins. If no GameServerVersion is supported, a warning is 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.
Adding the new player:
The player is then added to the party object and PartyPlugin.onAddPlayer is invoked to allow for initial customization of the player object. The player will be removed from any existing party before joining the new one. All party members are notified with the updated party state.