game / pragma.party / PartyService / respondToInviteV1 /

respondToInviteV1 #

suspend fun respondToInviteV1(session: PlayerSession, request: PartyRpc.RespondToInviteV1Request, sessionAction: SessionAction.Builder): PartyRpc.RespondToInviteV1Response

Responds to a party invite.

Invite validation:

The invite corresponding to the request’s invite ID is looked up. If the invite is not found or not intended for the player, errors with PragmaError.PartyService_InviteNotFound. If the player is already in the party, errors with PragmaError.PartyService_AlreadyInParty. If the party is already full, errors 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 via PartyRpc.UpdatePartyV1Request, the game server calculation will be skipped and the previously set gameServerVersion will be used.

Adding the invited player:

If the request is accepted, the player is then added to the party object and PartyPlugin.onAddPlayer is invoked to allow for initial customization of the player object, then all party members are notified with updated party state. The invite sender will receive an PartyRpc.InviteResponseV1Notification letting them know whether their invite was accepted or rejected.