game / pragma.party / PartyService / createV1 /

createV1 #

suspend fun createV1(session: PlayerSession, request: PartyRpc.CreateV1Request, sessionAction: SessionAction.Builder): PartyRpc.CreateV1Response

Creates a new party.

Party creation:

A new party is created and PartyPlugin.initializeParty is invoked to allow for initial customization of the party state. The player’s inventory is retrieved and cached for the service to use. If inventory retrieval fails, party creation will error with PragmaError.InventoryService_GetError. If the player is currently in matchmaking or match, fails with PragmaError.PartyService_InvalidSession. If the player is already in another party, it will fail with PragmaError.PartyService_AlreadyInParty.

GameServerVersion calculation:

Then GameServerCompatibilityPlugin.calculateGameServerVersion is invoked to determine the overall GameServerVersion for the party. If no GameServerVersion is available from the plugin, party creation will fail with PragmaError.PartyService_PartyClientVersionMismatch. If Party.overrideGameServerVersion was set during party initialization, the game server calculation will be skipped and plugins are expected to manually manage GameServerVersions.

Player added to party:

The player is then added to the party object and PartyPlugin.onAddPlayer is invoked to allow for initial customization of the player object.