game-common / pragma.gameinstance / GameInstancePlugin / handlePlayerCreateRequest /

handlePlayerCreateRequest #

open suspend fun handlePlayerCreateRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestingPlayerId: <ERROR CLASS>, requestExt: ExtPlayerCreateRequest)

Called when receiving a player request to create a game instance.

Add the player to the game instance using the GameInstance.GameInstance.addPlayer method. Set data on the game instance by using GameInstance.GameInstance.dataStore or GameInstance.GamePlayer.dataStore.

To prevent the game instance from being created, throw an application error.

Default implementation: prevents the game instance from being created.

Parameters #

gameInstanceSnapshot

The game instance to be created.

requestingPlayerId

The player id of the player requesting to create the game instance.

requestExt

The data sent along with the request.